package com.grandbroad.online.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import online.westonline.com.westonline.entry.EventModel;
import online.westonline.com.westonline.entry.NodeBean;

import com.grandbroad.online.greendao.EventModelDao;
import com.grandbroad.online.greendao.NodeBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig eventModelDaoConfig;
    private final DaoConfig nodeBeanDaoConfig;

    private final EventModelDao eventModelDao;
    private final NodeBeanDao nodeBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        eventModelDaoConfig = daoConfigMap.get(EventModelDao.class).clone();
        eventModelDaoConfig.initIdentityScope(type);

        nodeBeanDaoConfig = daoConfigMap.get(NodeBeanDao.class).clone();
        nodeBeanDaoConfig.initIdentityScope(type);

        eventModelDao = new EventModelDao(eventModelDaoConfig, this);
        nodeBeanDao = new NodeBeanDao(nodeBeanDaoConfig, this);

        registerDao(EventModel.class, eventModelDao);
        registerDao(NodeBean.class, nodeBeanDao);
    }
    
    public void clear() {
        eventModelDaoConfig.clearIdentityScope();
        nodeBeanDaoConfig.clearIdentityScope();
    }

    public EventModelDao getEventModelDao() {
        return eventModelDao;
    }

    public NodeBeanDao getNodeBeanDao() {
        return nodeBeanDao;
    }

}
